package cn.tedu.spring.life;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {
    // initMethod="自定义初始化方法名"的作用就相当于@PostConstruct
    // destroyMethod="自定义销毁方法名"的作用就相当于@PreDestroy
    @Bean(initMethod = "init", destroyMethod = "destroy")
    public CategoryService categoryService() {
        return new CategoryService();
    }
}
